Function.prototype._bind = function(context = window) {
    if(typeof this != 'function' || this == null) {
        throw new TypeError('error')
    }
    let self = this
    let args = [...arguments].splice(1)
    return function(...arguments) {
        return self.apply(context, args.concat(arguments))
    }
}

let obj = {
    name: '123',
    age: 12,
    myfun:function(a, b) {
        console.log(this.name + '年龄' + this.age + a + b);
    }
}
let obj1 = {
    name: '诚',
    age:18
}

obj.myfun._bind(obj1, [1, 2])(3, 4)